/**
 * 公共提示 add by gsh
 */
var msgWnd = window.parent.layer;
$(function() {
	msgWnd = window.parent.layer;
	msgWnd.config({
		  extend: 'extend/layer.ext.js'
	});
});
var msgTools = {
	alert : function(_title, _content, _timeout,_callback) {
		if (typeof (_timeout) == "undefined")
			_timeout = 2000;
		msgWnd.msg(_content, {
			title : _title,
			skin : 'layui-layer-lan',
			time : _timeout,
			icon : 1
		});
		if(typeof (_callback) != "undefined"){
			_callback(_content);
		}
	},
	closeFra : function(_timeout,_isRefresh,_callback) {
		if (typeof (_timeout) == "undefined")
			_timeout = 100;
		setTimeout(function() {
			if(_isRefresh){
			  var mainFra=parent.window.$("#rightFrame").get(0);
			  if(typeof(mainFra.contentWindow.reloadPg)=="undefined")
				  mainFra.src=mainFra.contentWindow.location.href;
			  else
				  mainFra.contentWindow.reloadPg();
			}
			var index = parent.layer.getFrameIndex(window.name);
			parent.layer.close(index);
		}, _timeout);
		if(typeof (_callback) != "undefined"){
			_callback(_content);
		}
	},
	alertCloseFra : function(_title, _content, _timeout,_callback) {
		this.closeFra(100);
		this.alert(_title, _content, _timeout,_callback);	
	},
	alertCloseFraRefresh : function(_title, _content, _timeout,_isRefresh,_callback) {
		this.closeFra(100,_isRefresh);
		this.alert(_title, _content, _timeout,_callback);	
	}
};
